//https://cn.vuejs.org/v2/guide/filters.html
import moment from "moment"
let QuestionType = value => {
    if (value === '') {
      return null
    } else {
      switch(value){
          case 0:
            return '选择';
          case 1:  
            return '判断';
          default: return value   
      }
    }
}

let JudgeType = value => {
    if (value === '') {
      return null
    } else {
      switch(value){
          case 0:
            return '正确';
          case 1:  
            return '错误';
          default: return value   
      }
    }
}

let SelectType = value => {
    if (value === '') {
      return null
    } else {
      switch(value){
          case 0:
            return 'A';
          case 1:  
            return 'B';
          case 2:  
            return 'C';
          case 3:  
            return 'D';
          default: return value   
      }
    }
}

let YTDHMS = value => {
    if(value === ''){
        return null
    }else{
        return moment(value).format('YYYY-MM-DD HH:mm:ss')
    }
}


export default {
    QuestionType,
    JudgeType,
    SelectType,
    YTDHMS
}